package com.cet.qz.unit01.chapter1_1;

import edu.princeton.cs.algs4.StdOut;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2020-12-07 06:14
 **/
public class Qz1_1_7a {
    public static void main(String[] args) {
        double t = 9.0;
        while (Math.abs(t - 9.0 / t )> 0.01) {
            t = (9.0/t +t)/2.0;
        }
        StdOut.printf("%.5f\n",t);
    }
}
